package com.yanqu.road.logic.bussiness.player.activity;

import com.yanqu.road.dao.impl.activity.peakstronghold.UserPeakStrongholdPatronsDaoImpl;
import com.yanqu.road.dao.impl.activity.peakstronghold.UserPeakStrongholdWarDataDaoImpl;
import com.yanqu.road.entity.activity.UserActivityConditionData;
import com.yanqu.road.entity.activity.peakstronghold.UserPeakStrongholdPatronsData;
import com.yanqu.road.entity.activity.peakstronghold.UserPeakStrongholdWarData;
import com.yanqu.road.entity.activity.stronghold.*;
import com.yanqu.road.logic.bussiness.DaoHelper;

import java.util.List;
import java.util.Map;

public class PeakStrongholdBusiness {
    public static Map<Integer, UserPeakStrongholdWarData> getStrongholdWarUserData(long userId) {
        return new UserPeakStrongholdWarDataDaoImpl().getStrongholdWarUserData(userId);
    }

    public static boolean addStrongholdUserData(UserPeakStrongholdWarData data) {
        return new UserPeakStrongholdWarDataDaoImpl().add(data);
    }

    public static boolean updateStrongholdUserData(UserPeakStrongholdWarData data) {
        return new UserPeakStrongholdWarDataDaoImpl().update(data);
    }

    public static Map<Integer, UserPeakStrongholdPatronsData> getStrongholdPatronsMap(int activityId, long userId) {
        return new UserPeakStrongholdPatronsDaoImpl().getStrongholdPatronsData(activityId,userId);
    }

    public static boolean addStrongholdPatrons(UserPeakStrongholdPatronsData patronsData) {
         return new UserPeakStrongholdPatronsDaoImpl().add(patronsData);
    }

    public static boolean updateStrongholdPatrons(UserPeakStrongholdPatronsData patronsData) {
        return new UserPeakStrongholdPatronsDaoImpl().update(patronsData);
    }

    public static boolean addUserActivityConditionData(UserActivityConditionData conditionData) {
       return DaoHelper.getUserStrongholdActivityDaoImpl().add(conditionData);
    }

    public static boolean updateUserActivityConditionData(UserActivityConditionData conditionData) {
        return DaoHelper.getUserStrongholdActivityDaoImpl().update(conditionData);
    }

    public static List<UserActivityConditionData> getUserActivityConditionDataList(int activityId, Integer conditionType, int rankNum) {
        return DaoHelper.getUserStrongholdActivityDaoImpl().getUserActivityConditionDataList( activityId,conditionType,rankNum);
    }

}
